package com.suncam.suncam2.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author LZM
 * @version 1.0
 * @Date 2022/1/13
 * @Description 消费用户消息
 */

@Component
@RabbitListener(queuesToDeclare = @Queue(value = "hello",durable = "true",autoDelete = "true"))
public class UserMq {
    private static final Logger log = LoggerFactory.getLogger(UserMq.class);

    @RabbitHandler
    public void receive(String msg){
        log.info("msg ===> {}",msg);
    }

}
